<{include file = '../include/user_header.html'}>

<ul class="list-group list-group-flush">
	<{foreach from = $follows item = $follow key = $key}>
	<li class="list-group-item">
		<div class="media pt-3">
			<a href="<{url('user','index',$follow.uid)}>"><img src="<{$follow.avatar}>" class="mr-3 rounded-circle" style="width:50px;"></a>
			<div class="media-body">
				<h6 color="<{$follow.group.font_color}>">
					<{$follow.username}>
			    
                    <{if $isme}>
    				<div class="float-right">
    				    <{if $key == \Model\UserfollowModel::POSITIVE_FOLLOW}>
    				    <button type="button" class="btn btn-outline-primary unfollow1" data-uid="<{$follow.uid}>"><i class="fa fa-check"></i> 已关注</button>
    				    <{else if $key == \Model\UserfollowModel::MUTUAL_FOLLOW}>
    				    <button type="button" class="btn btn-danger unfollow1" data-uid="<{$follow.uid}>"><i class="fa fa-check"></i> 互相关注</button>
    				    <{/if}>
    				</div>
    				<{/if}>
				</h6>
				<p>
					<span class="badge text-white" bgcolor="<{$follow.group.color}>">
						<{$follow.group.name}>
					</span>
				</p>
			</div>
		</div>
	</li>
	<{foreachelse}>
	<p class="text-center text-muted mt-5 mb-5">空空如也～</p>
	<{/foreach}>
</ul>
<div class="pt-3">
	<{pagination($count,30,$p_1,url('user','follows',$p_0,'{{page}}'))}>
</div>

<script>
$('.unfollow1').click(function() {
    $.get('<{url('user','unfollow',"'+$(this).data('uid')+'")}>',HuajiBBS.handleAjax);
});
</script>

<{include file = '../include/user_footer.html'}>